<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> 
<%@ page import="bean.User" %>
<%@ page import="dao.UserDao" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% String username=(String) request.getSession().getAttribute("userName"); %>
<script>
 function check_password(){
	 var oldpassword=document.getElementById('TxtOldPwd').value;
	 var newpassword=document.getElementById('TxtNewPwd').value;
	 var password=document.getElementById('TxtConInput').value;
	 if(oldpassword==newpassword){
		 alert("新密码和旧密码不能一样");
		 return false;
	 }
	 if(!(newpassword==password)){
		 alert("两次密码不一致");
		 return false;
	 }
 }
</script
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="<%=request.getContextPath() %>/css/SonPage.css" rel="stylesheet" type="text/css">
    <link href="<%=request.getContextPath() %>/css/Element.css" rel="stylesheet" type="text/css"> 
    <script src="<%=request.getContextPath() %>/js/Mtopt_1.1.js" type="text/javascript"></script>
    <script src="<%=request.getContextPath() %>/js/jquery-1.8.3.js" type="text/javascript"></script>
    <link href="<%=request.getContextPath() %>/css/ChangePwd.html.css" rel="stylesheet" type="text/css">
</head>
<body>  
  <% UserDao udao=new UserDao();
     User user=udao.findByName(username);
     int id=user.getId();
   %> 
<div class="DivForm">
    <form action="<%=request.getContextPath()%>/ChangePwdServlet" method="post">
    <div style=" padding-left:10px; width:100%; text-align:left;">
        <label class="LabelMain" style="font-size:22px;">修改密码</label>
        <label class="LabelMain" style="font-size:13px;">-通过旧密码</label>
    </div>
    <div id="DivWindow" class="DivWindow">
        <table cellspacing="1" class="Table">
          <tbody>
            <tr>
               <td><input type="hidden" id="id" name="id" value="<%=id%>"></td>
            </tr>
            <tr>
                <td class="Text">
                    <label>账户: </label></td>
                <td colspan="2">
                    <input id="TxtUid" name="TxtUid" type="text" class="TextMain" style="width: 150px;" value="<%=username%>"></td>
            </tr>
            <tr>
                <td class="Text">
                    <label>旧密码: </label></td>
                <td colspan="2">
                    <input id="TxtOldPwd" type="password" class="TextDefault" style="width: 150px;"></td>
            </tr>
            <tr>
                <td class="Text">
                    <label>新密码: </label></td>
                <td colspan="2">
                    <input id="TxtNewPwd" type="password" class="TextDefault" style="width: 150px;"></td>
            </tr>
            <tr>
                <td class="Text">
                    <label>再次输入: </label></td>
                <td colspan="2">
                    <input id="TxtConInput" name="TxtConInput" type="password" class="TextDefault" style="width: 150px;"></td>
            </tr>
            <tr>
                <td class="Text">
                    <label>验证码: </label></td>
                <td style="width: 60px;">
                    <input id="TxtIdentifying" maxlength="5" type="text" class="TextDefault" style="width: 80px;"></td>
                <td>
                    <img id="Identifying" alt="" title="更换验证码" src="../GetIdentifyingCode.ashx" onclick="RefreshIdentifying();" style="cursor:pointer;"></td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td colspan="2">
                    <div id="DivMessage" style="font-size:12px;"></div></td>
            </tr>
            <tr>
                <td class="Text">&nbsp;</td>
                <td colspan="2">
                    <button id="BtnModity" type="submit" value="立即修改" class="ButtonMain" style="width: 90px;" onclick="return check_password()">立即修改</button>
                    <button id="BtnClear" type="reset" value="清空" class="ButtonDefault" style="width: 50px;">清空</button>
                </td>
            </tr>
        </tbody>
      </table>
    </div>
    </form>
</div>
    <script src="../OfPwd.html.js" type="text/javascript"></script>
</body>
</html>